NAMES2DOS

Section: User Commands (1)
Updated: Local
Index Return to Main Contents
 

NAME

names2dos - convert a directory tree to MS-DOS compliant filenames.  

SYNOPSIS

names2dos [-DEBUG | -d | -V | -L | -h ] directory_tree_ROOT  

DESCRIPTION

names2dos converts filenames in the directory-tree specified to MS-DOS conventions.

Typical use for names2dos is in porting software from a Unix system to MS-DOS. A copy of the source code directory tree is made under Unix, then names2dos is run on the copied tree. The converted directory tree is then ``bundled up'' with tar, arc, zip, etc., and downloaded to the MS-DOS system.

NOTE:
names2dos should only be run on a copy of the directory tree you wish to convert. The script will change file and directory names and the contents of files, as necessary, without making backup copies of those files.

The script will only work on file and directory names in the named subdirectory. If the command:

names2dos NFSmt_point/Sys_Type.SUN4/src.local/groff.1.0.7

is given, only the directory name groff.1.0.7 and any files or directories that it contains will be changed, even though all the other directory names in the path are not DOS compatible.

Any characters that are invalid for MS-DOS filenames are replaced with a dash (hyphen). The script attempts to deal with unusual filenames, including those containing <SPACE>, *, ?, (, ), [, ], and <QUOTE> characters.

Hidden (``dot'') files have the initial period changed to an underline.

Files who's names end with a trailing period have an underline appended to their name. This is because MS-DOS doesn't distinguish between filename and filename. .

Filenames are shortened and components of filenames (separated by periods) may be combined. The file and directory names are checked to be unique after they are created. If a non-unique filename is generated, the last character in the base section is changed in an attempt to make the filename unique.

Once all changes are made to directory and file names, names2dos checks each file in the directory tree for references to file names that have been changed. The contents of these files are altered to refer to the re-named files.  

OPTIONS

-DEBUG
Debugging. In this mode, names2dos is more verbose, and all temporary files are saved. This is useful if you are trying to determine why names2dos failed on a previous run. The debugging option can be combined with the -d option.
-d
This option instructions names2dos to make changes to the contents of files that contain reference to devices that have different names under MS-DOS. Currently, the following changes are possible:
/dev/null  rh  /dev/nul
/dev/tty  rh  /dev/con
-V
Report the version number of names2dos and exit without processing.
-L
Report any known limits to names2dos and exit without processing.
-h
Display a help message and exit without processing.
 

FILES

There are six files created by names2dos. All but the log file are created in /tmp and use unique names. All intermediate files will be removed at the successful completion of names2dos, unless the -DEBUG option is chosen.

The log file, changes.log, is a verbose log of the changes made to the directory tree. This is placed in the current directory and will silently over-write any existing file of the same name.  

AUTHOR

Mark Bergman
bergman@panix.com  

EXAMPLES

names2dos directory_tree_root
Run names2dos on the specified directory_tree_root. No debugging, no device names will be changed, and the file changes.log will record all changes made to directory_tree_root.

Converted filenames:

UNIX Name                          MS-DOS Name

joe                                joe
josephTsmith                       josepht
primes+squares.c                   primes_s.c
Makefile.toplevel.Patch.16         makefile.16
font.postscript.Helvetica          font_pos.hel
base.1.2.3.extension               base_1_2.ext
PostScript.font.viewer.cc          postscri.cc

 

DIAGNOSTICS

Various sanity checks are attempted to make sure that the specified directory tree exists, that the attempt to change filenames had no errors, etc.

If a unique name cannot be created a warning is added to the log file.  

BUGS

Due to the nature of the problem of converting filenames and typical naming conventions some problems do arise. The most frequent problem is in a makefile, where the names of dependent files are not properly changed.

For example, if the directory to convert to MS-DOS naming standards contains the ``C'' source file named:
           build.fonts.c
this would be re-named:
           build_fo.c
and all references to build.fonts.c would be correctly changed within files. However, a makefile might very well depend on the executable version---named build.fonts. This name would not be changed, and any attempts to run build.fonts (silently truncated by MS-DOS to build.fo) would fail.

No attempt is made to change references within files to directory names that have been converted. This change would be very difficulty, due to the iterative method for changing directory names, and probably is not needed very often.

The script will probably fail hard on filenames with 8-bit characters.  

LIMITS

All limits found in the versions of awk, sed, and other tools are imposed on names2dos. GNU awk and sed are highly reccommended.

Errors from sed complaining about ``Too much command text'' indicate a need for GNU sed.

There is also a limit of 41 character substitutions that will be made in an attempt to generate a unique filename.  

VERSION

names2dos version:  2.1 1993/04/13 04:01:33 bergman 
names2dos awk script version:  2.0 1993/04/11 23:36:01 bergman 
 

RESTRICTIONS

This script is covered under the GPL. Please send any changes, comments, bug fixes, etc. to: Mark Bergman
bergman@panix.com
...!{uunet,cmcl2}!panix!bergman
718-855-9148


 

Index

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
FILES
AUTHOR
EXAMPLES
DIAGNOSTICS
BUGS
LIMITS
VERSION
RESTRICTIONS

This document was created by man2html, using the manual pages.
Time: 01:23:59 GMT, June 24, 2025